home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_tem_spikesup.cog < prev    next >
Text File  |  1999-11-15  |  4KB  |  143 lines

  1. # Jones 3D Cog Script
  2. #
  3. # TEM_SpikesUp.cog
  4. # Player is killed when he falls on spikes that are up.
  5. #
  6. # [TRM]
  7. #
  8. # (C) 1999 LucasArts Entertainment Co. All Rights Reserved
  9. # ========================================================================================
  10.  
  11. symbols
  12.  
  13.     message     startup
  14.     message     entered
  15.     #message     exited
  16.     message     touched
  17.            
  18.     thing       player      local
  19.     thing       deadIndy    local
  20.     thing       cam1
  21.     
  22.     thing       spike0
  23.     thing       spike1
  24.     thing       spike2
  25.     thing       spike3
  26.     thing       spike4
  27.     thing       spike5
  28.     thing       spike6
  29.     
  30.     surface     safeSpot
  31.     surface     dangerSpot1
  32.     surface     dangerSpot2
  33.     
  34.     template    tpl_Indy=indy_sh_actor      local
  35.  
  36.     keyframe    inDie=in_die_buckle.key     local
  37.     
  38.     sound       sndDie=tem_temspikes_up_kill_c.wav      local
  39.     sound       say_Ugh=inxj018a.wav                    local
  40.     
  41.     int         victim            local
  42.     int         safe=0          local
  43.     int         deadMan=0       local
  44.     int         index           local
  45.     int         numSpikes=7     local
  46.     
  47. end
  48.        
  49. # ========================================================================================
  50.  
  51. code
  52.  
  53. startup:
  54.  
  55.     player = GetLocalPlayerThing();
  56.     return;
  57.     
  58. # ========================================================================================
  59.  
  60. entered:
  61.  
  62.     if((GetSenderRef() == safeSpot) && (safe == 0))
  63.     {
  64.         safe = 1;
  65.     }
  66.     
  67.     if(GetSenderRef() == dangerSpot1)
  68.     {
  69.         safe = 0;
  70.     }
  71.     
  72.     if(GetSenderRef() == dangerSpot2)
  73.     {
  74.         safe = 0;
  75.     }
  76.         
  77.     return;
  78.  
  79. # ========================================================================================
  80.  
  81. #exited:
  82. #
  83. #    if((GetSenderRef() == safeSpot) && (GetSourceRef() == player))
  84. #    {
  85. #        Sleep(1.0);     # hack
  86. #        safe = 0;
  87. #    }
  88. #        
  89. #    return;
  90.     
  91. # ========================================================================================
  92.  
  93. touched:
  94.  
  95.     if(safe == 1) return;
  96.     
  97.     for (index = 0; index < numSpikes; index = index + 1)
  98.     {    
  99.         if((GetSenderRef() == spike0[index]) && (deadMan == 0))
  100.         {
  101.             deadMan = 1;
  102.             
  103.             SetCollideType(spike0, 0);
  104.             SetCollideType(spike1, 0);
  105.             SetCollideType(spike2, 0);
  106.             SetCollideType(spike3, 0);
  107.             SetCollideType(spike4, 0);
  108.             SetCollideType(spike5, 0);
  109.             SetCollideType(spike6, 0);
  110.             
  111.             # kill the player
  112.             DamageThing(player, 1000.0, 0x1, victim);
  113.             Sleep(0.1);
  114.             
  115.             PlaySoundLocal(sndDie, 1.0, 0.0, 0x0, 0);
  116.             PlaySoundLocal(say_Ugh, 1.0, 0.0, 0x0, 0);
  117.                                 
  118.             # Cut to camera with focus on player
  119.             SetCurrentCamera(2);
  120.             SetCameraFocus(2, cam1);
  121.             SetCameraSecondaryFocus(2, player);
  122.             SetCameraFOV(90, 0, 0.0);
  123.             
  124.             # hide player
  125.             SetThingFlags(player, 0x80000);
  126.             
  127.             deadIndy = CreateThing(tpl_Indy, player);
  128.             CaptureThing(deadIndy);
  129.                                 
  130.             # Show actor Indy and play Keyframe
  131.             ClearThingFlags(deadIndy, 0x80000);
  132.             PlayKey(deadIndy, inDie, 4, 0x14, 0);
  133.         }
  134.     }
  135.     
  136.     return;
  137.  
  138. # ========================================================================================
  139.  
  140. end
  141.  
  142.